<template>
	<view class="all">
		<view class="navgator" :style="`background-color: ${bgColor}; padding-top:${statusHeight}px ;`">
			<image mode="widthFix" src="../../static/f2.png" class="menu" @click="closeBack"></image>
			<view class="center">
				<label class="title">收款</label>

			</view>
			<image mode="widthFix" src="../../static/exchangeSetting.png" class="scan"></image>
		</view>
		<view class="BGVIEw">
			
	
		<view class="bg" :style="`background-color: ${bgColor}; heigth:calc(100vh-${statusHeight}px)`">


			<image class="tipETH" mode="widthFix" src="../../static/img52.png" v-if="currWallet.name == 'ETH'"></image>

			<view class="main">
				<label class="miaoshu">扫描二维码，转入{{currWallet.name}}</label>
				<view class="ercodeView">
					<image class="kuang" src="../../static/img22.jpg" mode="widthFix"></image>
					<image class="ercode" src="../../static/erw.png" mode="widthFix"></image>
				</view>

				<label class="wallTip">钱包地址</label>
				<label class="walladdr">{{currWallet.addr}}</label>
			</view>
			<view class="btnView">
				<view class="shareBtn">
					<image class="shaImg" src="../../static/share.png" mode="widthFix"></image>
					<label class="shaLabel">分享</label>
				</view>
				<view class="line"></view>
				<view class="shareBtn" @click="copy">
					<image class="shaImg" src="../../static/copy.png" mode="widthFix"></image>
					<label class="shaLabel">复制</label>
				</view>
			</view>

			<image class="biao" src="../../static/img5.png" mode="widthFix"></image>


		</view>
		
			</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				currWallet: {},
				bgColor: ''
			}
		},
		onLoad(options) {
			this.currWallet = JSON.parse(options.currWallet)
			if (this.currWallet.name == 'ETH') {
				this.bgColor = '#0792C1'
			} else {
				this.bgColor = '#F24F4A'
			}
		},
		methods: {

			closeBack() {
				this.Api.back()
			},
			copy() {
				var that = this
				console.log("jinlai")
				uni.setClipboardData({
					data: that.currWallet.addr,
					success(res) {
						that.Api.toast("复制成功")
					}
				})
			}
		},
		computed: {
			//状态栏高度
			statusHeight() {
				return uni.getSystemInfoSync().statusBarHeight + 20 || 10; //如果没有获取到高度，那么指定10px；
			}
		},
	}
</script>

<style scoped>
	.all{
		display: flex;
		height: 100vh;
		flex-direction: column;
	}
	.navgator {
		
		width: 100%;
		display: flex;
		box-sizing: border-box;
		align-items: center;
		height: 120rpx;
		padding: 40rpx 40rpx;

	}

	.menu {
		width: 40rpx;

	}

	.scan {
		width: 50rpx;


	}

	.center {
		flex: 1;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
.BGVIEw{
	width: 100%;
	flex: 1;

position: relative;
}
	.bg {
		width: 100%;
		height: 100%;
		
		position: absolute;
		box-sizing: border-box;
		padding: 20rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		left:0 ;
		top: 0rpx;
	}

	.tipETH {
		width: 90%;
		margin: 40rpx;
	}

	.main {
		width: 90%;
		border-radius: 10rpx;
		background-color: white;
		display: flex;
		padding: 40rpx;
		margin-top: 20rpx;
		z-index: 999;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.miaoshu {
		color: #D7D7D7;
		font-size: 30rpx;
		margin-top: 60rpx;
	}

	.ercodeView {
		display: flex;
		flex-direction: column;
		margin-top: 30rpx;
		width: 60%;
		height: 50vw;

		position: relative;
	}

	.kuang {
		position: absolute;
		width: 100%;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
	}

	.ercode {
		position: absolute;
		width: 90%;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
	}

	.wallTip {
		color: #D7D7D7;
		font-size: 30rpx;
		margin-top: 60rpx;
	}

	.walladdr {
		width: 80%;
		margin-top: 30rpx;
		text-align: center;
		display: inline-block;
		white-space: pre-wrap;
		word-wrap: break-word;
	}

	.btnView {
		width: 100%;
		border-radius: 10rpx;
		margin-top: -10rpx;
		display: flex;
		flex-direction: row;
		padding: 40rpx;
		align-items: center;
		box-sizing: border-box;
		justify-content: space-between;
		background-color: #EEEEEE;

	}

	.line {
		width: 1px;
		height: 20rpx;
		background-color: #CDCCCC;
	}

	.shareBtn {
		width: 50%;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;

	}

	.shaImg {
		width: 50rpx;
		margin-right: 20rpx;
	}

	.biao {
		margin-top: 80rpx;
		width: 120rpx;
	}
</style>
